<template>
  <div class="home">
    <!-- 实现基于ek-tree组件的过滤，不包含子节点 -->
    <el-form :model="form" class="form" :inline="true" label-with="100px" size="small">
      <el-form-item label="组织名称">
        <el-input v-model="form.organizationName" clearable placeholder="请输入组织名称"></el-input>
      </el-form-item>
      <el-form-item label="状态">
        <el-select v-model="form.orgStatus" clearable placeholder="请选择状态">
          <el-option label="正常" value="0"></el-option>
          <el-option label="禁用" value="1"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="handleSearch">搜索</el-button>
        <el-button @click="handleReset">重置</el-button>
        <el-switch class="el-switch-btn" @change="handleSearch" v-model="keepChild" active-text="保留子节点"
          inactive-text="不保留子节点">
        </el-switch>
      </el-form-item>
    </el-form>
    <el-table :data="showData" row-key="index" border default-expand-all
      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" max-height="1000">
      <el-table-column prop="treeLabel" min-width="180">
        <template slot="header">
          <p class="organization-name">组织名称</p>
        </template>
      </el-table-column>
      <el-table-column prop="sort" label="排序" width="180" align="center" />
      <el-table-column label="状态" width="220" align="center">
        <template slot-scope="{row}">
          <p v-if="row.orgStatus == '0'">正常</p>
          <p v-if="row.orgStatus == '1'">禁用</p>
        </template>
      </el-table-column>
      <el-table-column prop="createTime" label="创建时间" width="260" align="center" />
      <el-table-column label="操作" width="310" align="center">
        <template slot-scope="{row}">
          <el-button type="text" size="small" @click="handleEdit(row)">修改</el-button>
          <el-button type="text" size="small" v-if="row.dataLevel != 'SITE'" @click="handleAdd(row)">新增</el-button>
          <el-button type="text" size="small" v-if="row.dataLevel != 'GROUP'" @click="handleDelete(row.id)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-tree style="display: none;" class="filter-tree" :data="tableData" :props="defaultProps" default-expand-all
      :filter-node-method="filterNode" ref="orgTree">
    </el-tree>
  </div>
</template>
<script>

export default {
  name: 'home-view',
  data() {
    return {
      tableData: [
        { "orgStatus": 0, "companyNo": "00000-00001", "createTime": null, "companyName": "环卫集团", "intro": "<p>重庆市环卫集团有限公司（以下简称“重庆环卫集团”）成立于2002年，是重庆市人民政府出资组建的大型国有企业，主要从事固废垃圾收运处理、重要环卫基础设施建设和运营管理工作。近年来，重庆环卫集团大力实施创新驱动发展战略，企业发展迅猛，职工人数由100余人发展到  #people#  余人，资产规模由1亿元增长到 #Asset size#亿元！</p><p>好耶！</p><p>#text#</p><p>你好！！！！</p><p>好耶！！！！</p>", "id": 1, "parentId": 0, "treeLabel": "环卫集团", "dataLevel": "GROUP", "index": "0", "sort": "0", "children": [{ "orgStatus": 1, "companyNo": "99999-99999", "createTime": null, "companyName": "其他公司", "intro": "测试文本内容", "id": 10000, "parentId": 1, "treeLabel": "其他公司", "dataLevel": "COMPANY", "index": 1, "sort": 1, "children": [] }, { "orgStatus": 0, "companyNo": "00005-00005", "createTime": null, "companyName": "南川益川公司", "intro": null, "id": 22, "parentId": 1, "treeLabel": "南川益川公司", "dataLevel": "COMPANY", "index": 2, "sort": 2, "children": [{ "orgStatus": 0, "projectNo": "10049", "companyNo": "00005-00005", "createTime": null, "companyName": "南川益川公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 49, "projectName": "南川生活垃圾收运", "treeLabel": "南川生活垃圾收运", "dataLevel": "PROJECT", "index": "2-1", "sort": 1, "children": [{ "projectNo": "10049", "siteNo": "00036", "companyNo": "00005-00005", "companyName": "南川益川公司", "siteName": "南川转运站", "id": 57, "projectName": "南川生活垃圾收运", "treeLabel": "南川转运站", "disabled": true, "dataLevel": "SITE", "index": "2-1-1", "sort": 1, "orgStatus": 1 }] }, { "orgStatus": 0, "projectNo": "10050", "companyNo": "00005-00005", "createTime": null, "companyName": "南川益川公司", "projectType": "PANTRY_RECEIVE", "id": 50, "projectName": "南川餐厨垃圾收运", "treeLabel": "南川餐厨垃圾收运", "dataLevel": "PROJECT", "index": "2-2", "sort": 2 }, { "orgStatus": 0, "projectNo": "10051", "companyNo": "00005-00005", "createTime": null, "companyName": "南川益川公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 51, "projectName": "武隆生活垃圾收运", "treeLabel": "武隆生活垃圾收运", "dataLevel": "PROJECT", "index": "2-3", "sort": 3 }] }, { "orgStatus": 0, "companyNo": "00005-00004", "createTime": null, "companyName": "长寿益畅公司", "intro": null, "id": 21, "parentId": 1, "treeLabel": "长寿益畅公司", "dataLevel": "COMPANY", "index": 3, "sort": 3, "children": [{ "orgStatus": 1, "projectNo": "10047", "companyNo": "00005-00004", "createTime": null, "companyName": "长寿益畅公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 47, "projectName": "长寿生活垃圾收运", "treeLabel": "长寿生活垃圾收运", "dataLevel": "PROJECT", "index": "3-1", "sort": 1, "children": [{ "projectNo": "10047", "siteNo": "00035", "companyNo": "00005-00004", "companyName": "长寿益畅公司", "siteName": "长寿转运站", "id": 55, "projectName": "长寿生活垃圾收运", "treeLabel": "长寿转运站", "disabled": true, "dataLevel": "SITE", "index": "3-1-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10048", "companyNo": "00005-00004", "createTime": null, "companyName": "长寿益畅公司", "projectType": "PANTRY_RECEIVE", "id": 48, "projectName": "长寿餐厨垃圾收运", "treeLabel": "长寿餐厨垃圾收运", "dataLevel": "PROJECT", "index": "3-2", "sort": 2 }] }, { "orgStatus": 0, "companyNo": "00005-00003", "createTime": null, "companyName": "綦江益创公司", "intro": null, "id": 20, "parentId": 1, "treeLabel": "綦江益创公司", "dataLevel": "COMPANY", "index": 4, "sort": 4, "children": [{ "orgStatus": 0, "projectNo": "10044", "companyNo": "00005-00003", "createTime": null, "companyName": "綦江益创公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 44, "projectName": "綦江生活垃圾收运", "treeLabel": "綦江生活垃圾收运", "dataLevel": "PROJECT", "index": "4-1", "sort": 1, "children": [{ "projectNo": "10044", "siteNo": "00034", "companyNo": "00005-00003", "companyName": "綦江益创公司", "siteName": "綦江转运站", "id": 52, "projectName": "綦江生活垃圾收运", "treeLabel": "綦江转运站", "disabled": true, "dataLevel": "SITE", "index": "4-1-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10045", "companyNo": "00005-00003", "createTime": null, "companyName": "綦江益创公司", "projectType": "PANTRY_RECEIVE", "id": 45, "projectName": "綦江餐厨垃圾收运", "treeLabel": "綦江餐厨垃圾收运", "dataLevel": "PROJECT", "index": "4-2", "sort": 2 }, { "orgStatus": 0, "projectNo": "10046", "companyNo": "00005-00003", "createTime": null, "companyName": "綦江益创公司", "projectType": "PANTRY_RECEIVE", "id": 46, "projectName": "万盛餐厨垃圾收运", "treeLabel": "万盛餐厨垃圾收运", "dataLevel": "PROJECT", "index": "4-3", "sort": 3 }] }, { "orgStatus": 0, "companyNo": "00005-00002", "createTime": null, "companyName": "江津益江公司", "intro": null, "id": 19, "parentId": 1, "treeLabel": "江津益江公司", "dataLevel": "COMPANY", "index": 5, "sort": 5, "children": [{ "orgStatus": 0, "projectNo": "10040", "companyNo": "00005-00002", "createTime": null, "companyName": "江津益江公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 40, "projectName": "江津生活垃圾收运", "treeLabel": "江津生活垃圾收运", "dataLevel": "PROJECT", "index": "5-1", "sort": 1, "children": [{ "projectNo": "10040", "siteNo": "00033", "companyNo": "00005-00002", "companyName": "江津益江公司", "siteName": "江津转运站", "id": 48, "projectName": "江津生活垃圾收运", "treeLabel": "江津转运站", "disabled": true, "dataLevel": "SITE", "index": "5-1-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10041", "companyNo": "00005-00002", "createTime": null, "companyName": "江津益江公司", "projectType": "PANTRY_RECEIVE", "id": 41, "projectName": "江津餐厨垃圾收运", "treeLabel": "江津餐厨垃圾收运", "dataLevel": "PROJECT", "index": "5-2", "sort": 2 }, { "orgStatus": 0, "projectNo": "10042", "companyNo": "00005-00002", "createTime": null, "companyName": "江津益江公司", "projectType": "PANTRY_RECEIVE", "id": 42, "projectName": "永川餐厨垃圾收运", "treeLabel": "永川餐厨垃圾收运", "dataLevel": "PROJECT", "index": "5-3", "sort": 3 }, { "orgStatus": 0, "projectNo": "10043", "companyNo": "00005-00002", "createTime": null, "companyName": "江津益江公司", "projectType": "PANTRY_RECEIVE", "id": 43, "projectName": "双桥餐厨垃圾收运", "treeLabel": "双桥餐厨垃圾收运", "dataLevel": "PROJECT", "index": "5-4", "sort": 4 }] }, { "orgStatus": 0, "companyNo": "00005-00001", "createTime": null, "companyName": "垫江明洁公司", "intro": null, "id": 18, "parentId": 1, "treeLabel": "垫江明洁公司", "dataLevel": "COMPANY", "index": 6, "sort": 6, "children": [{ "orgStatus": 0, "projectNo": "10039", "companyNo": "00005-00001", "createTime": null, "companyName": "垫江明洁公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 39, "projectName": "垫江生活垃圾收运", "treeLabel": "垫江生活垃圾收运", "dataLevel": "PROJECT", "index": "6-1", "sort": 1 }] }, { "orgStatus": 0, "companyNo": "00000-00017", "createTime": null, "companyName": "渝卫公司", "intro": null, "id": 17, "parentId": 1, "treeLabel": "渝卫公司", "dataLevel": "COMPANY", "index": 7, "sort": 7, "children": [{ "orgStatus": 0, "projectNo": "10073", "companyNo": "00000-00017", "createTime": null, "companyName": "渝卫公司", "projectType": "COMPOSITE", "id": 73, "projectName": "检验检测", "treeLabel": "检验检测", "dataLevel": "PROJECT", "index": "7-1", "sort": 1 }] }, { "orgStatus": 0, "companyNo": "00000-00016", "createTime": null, "companyName": "黔江益博公司", "intro": null, "id": 16, "parentId": 1, "treeLabel": "黔江益博公司", "dataLevel": "COMPANY", "index": 8, "sort": 8, "children": [{ "orgStatus": 0, "projectNo": "10067", "companyNo": "00000-00016", "createTime": null, "companyName": "黔江益博公司", "projectType": "PANTRY_RECEIVE", "id": 67, "projectName": "黔江餐厨垃圾收运", "treeLabel": "黔江餐厨垃圾收运", "dataLevel": "PROJECT", "index": "8-1", "sort": 1 }, { "orgStatus": 0, "projectNo": "10068", "companyNo": "00000-00016", "createTime": null, "companyName": "黔江益博公司", "projectType": "PANTRY_DISPOSALS", "id": 68, "projectName": "黔江餐厨垃圾处置", "treeLabel": "黔江餐厨垃圾处置", "dataLevel": "PROJECT", "index": "8-2", "sort": 2 }, { "orgStatus": 0, "projectNo": "10069", "companyNo": "00000-00016", "createTime": null, "companyName": "黔江益博公司", "projectType": "PANTRY_DISPOSALS", "id": 69, "projectName": "彭水餐厨垃圾处置", "treeLabel": "彭水餐厨垃圾处置", "dataLevel": "PROJECT", "index": "8-3", "sort": 3 }, { "orgStatus": 0, "projectNo": "10070", "companyNo": "00000-00016", "createTime": null, "companyName": "黔江益博公司", "projectType": "PANTRY_DISPOSALS", "id": 70, "projectName": "酉阳餐厨垃圾处置", "treeLabel": "酉阳餐厨垃圾处置", "dataLevel": "PROJECT", "index": "8-4", "sort": 4 }, { "orgStatus": 0, "projectNo": "10071", "companyNo": "00000-00016", "createTime": null, "companyName": "黔江益博公司", "projectType": "PANTRY_DISPOSALS", "id": 71, "projectName": "彭水餐厨垃圾处置", "treeLabel": "彭水餐厨垃圾处置", "dataLevel": "PROJECT", "index": "8-5", "sort": 5 }, { "orgStatus": 0, "projectNo": "10072", "companyNo": "00000-00016", "createTime": null, "companyName": "黔江益博公司", "projectType": "PERISHABLE_DISPOSALS", "id": 72, "projectName": "病死畜禽处置", "treeLabel": "病死畜禽处置", "dataLevel": "PROJECT", "index": "8-6", "sort": 6 }] }, { "orgStatus": 0, "companyNo": "00000-00015", "createTime": null, "companyName": "永川益景公司", "intro": null, "id": 15, "parentId": 1, "treeLabel": "永川益景公司", "dataLevel": "COMPANY", "index": 9, "sort": 9, "children": [{ "orgStatus": 0, "projectNo": "10064", "companyNo": "00000-00015", "createTime": null, "companyName": "永川益景公司", "projectType": "PANTRY_DISPOSALS", "id": 64, "projectName": "永川餐厨垃圾处置", "treeLabel": "永川餐厨垃圾处置", "dataLevel": "PROJECT", "index": "9-1", "sort": 1, "children": [{ "projectNo": "10064", "siteNo": "00023", "companyNo": "00000-00015", "companyName": "永川益景公司", "siteName": "永川餐厨厂", "id": 72, "projectName": "永川餐厨垃圾处置", "treeLabel": "永川餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "9-1-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10065", "companyNo": "00000-00015", "createTime": null, "companyName": "永川益景公司", "projectType": "PANTRY_DISPOSALS", "id": 65, "projectName": "大足餐厨垃圾处置", "treeLabel": "大足餐厨垃圾处置", "dataLevel": "PROJECT", "index": "9-2", "sort": 2, "children": [{ "projectNo": "10065", "siteNo": "00023", "companyNo": "00000-00015", "companyName": "永川益景公司", "siteName": "永川餐厨厂", "id": 73, "projectName": "大足餐厨垃圾处置", "treeLabel": "永川餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "9-2-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10066", "companyNo": "00000-00015", "createTime": null, "companyName": "永川益景公司", "projectType": "PANTRY_DISPOSALS", "id": 66, "projectName": "荣昌餐厨垃圾处置", "treeLabel": "荣昌餐厨垃圾处置", "dataLevel": "PROJECT", "index": "9-3", "sort": 3, "children": [{ "projectNo": "10066", "siteNo": "00023", "companyNo": "00000-00015", "companyName": "永川益景公司", "siteName": "永川餐厨厂", "id": 74, "projectName": "荣昌餐厨垃圾处置", "treeLabel": "永川餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "9-3-1", "sort": 1, "orgStatus": 0 }] }] }, { "orgStatus": 0, "companyNo": "00000-00014", "createTime": null, "companyName": "綦江益恒公司", "intro": null, "id": 14, "parentId": 1, "treeLabel": "綦江益恒公司", "dataLevel": "COMPANY", "index": 10, "sort": 10, "children": [{ "orgStatus": 0, "projectNo": "10061", "companyNo": "00000-00014", "createTime": null, "companyName": "綦江益恒公司", "projectType": "PANTRY_DISPOSALS", "id": 61, "projectName": "綦江餐厨垃圾处置", "treeLabel": "綦江餐厨垃圾处置", "dataLevel": "PROJECT", "index": "10-1", "sort": 1, "children": [{ "projectNo": "10061", "siteNo": "00022", "companyNo": "00000-00014", "companyName": "綦江益恒公司", "siteName": "綦江餐厨厂", "id": 69, "projectName": "綦江餐厨垃圾处置", "treeLabel": "綦江餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "10-1-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10062", "companyNo": "00000-00014", "createTime": null, "companyName": "綦江益恒公司", "projectType": "PANTRY_DISPOSALS", "id": 62, "projectName": "南川餐厨垃圾处置", "treeLabel": "南川餐厨垃圾处置", "dataLevel": "PROJECT", "index": "10-2", "sort": 2, "children": [{ "projectNo": "10062", "siteNo": "00022", "companyNo": "00000-00014", "companyName": "綦江益恒公司", "siteName": "綦江餐厨厂", "id": 70, "projectName": "南川餐厨垃圾处置", "treeLabel": "綦江餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "10-2-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10063", "companyNo": "00000-00014", "createTime": null, "companyName": "綦江益恒公司", "projectType": "PANTRY_DISPOSALS", "id": 63, "projectName": "万盛餐厨垃圾处置", "treeLabel": "万盛餐厨垃圾处置", "dataLevel": "PROJECT", "index": "10-3", "sort": 3, "children": [{ "projectNo": "10063", "siteNo": "00022", "companyNo": "00000-00014", "companyName": "綦江益恒公司", "siteName": "綦江餐厨厂", "id": 71, "projectName": "万盛餐厨垃圾处置", "treeLabel": "綦江餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "10-3-1", "sort": 1, "orgStatus": 0 }] }] }, { "orgStatus": 0, "companyNo": "00000-00013", "createTime": null, "companyName": "涪陵益晖公司", "intro": null, "id": 13, "parentId": 1, "treeLabel": "涪陵益晖公司", "dataLevel": "COMPANY", "index": 11, "sort": 11, "children": [{ "orgStatus": 0, "projectNo": "10059", "companyNo": "00000-00013", "createTime": null, "companyName": "涪陵益晖公司", "projectType": "PANTRY_DISPOSALS", "id": 59, "projectName": "涪陵餐厨垃圾处置", "treeLabel": "涪陵餐厨垃圾处置", "dataLevel": "PROJECT", "index": "11-1", "sort": 1, "children": [{ "projectNo": "10059", "siteNo": "00021", "companyNo": "00000-00013", "companyName": "涪陵益晖公司", "siteName": "涪陵餐厨厂", "id": 67, "projectName": "涪陵餐厨垃圾处置", "treeLabel": "涪陵餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "11-1-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10060", "companyNo": "00000-00013", "createTime": null, "companyName": "涪陵益晖公司", "projectType": "PANTRY_DISPOSALS", "id": 60, "projectName": "长寿餐厨垃圾处置", "treeLabel": "长寿餐厨垃圾处置", "dataLevel": "PROJECT", "index": "11-2", "sort": 2, "children": [{ "projectNo": "10060", "siteNo": "00021", "companyNo": "00000-00013", "companyName": "涪陵益晖公司", "siteName": "涪陵餐厨厂", "id": 68, "projectName": "长寿餐厨垃圾处置", "treeLabel": "涪陵餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "11-2-1", "sort": 1, "orgStatus": 0 }] }] }, { "orgStatus": 0, "companyNo": "00000-00012", "createTime": null, "companyName": "合川益睿公司", "intro": null, "id": 12, "parentId": 1, "treeLabel": "合川益睿公司", "dataLevel": "COMPANY", "index": 12, "sort": 12, "children": [{ "orgStatus": 0, "projectNo": "10057", "companyNo": "00000-00012", "createTime": null, "companyName": "合川益睿公司", "projectType": "PANTRY_DISPOSALS", "id": 57, "projectName": "合川餐厨垃圾处置", "treeLabel": "合川餐厨垃圾处置", "dataLevel": "PROJECT", "index": "12-1", "sort": 1, "children": [{ "projectNo": "10057", "siteNo": "00020", "companyNo": "00000-00012", "companyName": "合川益睿公司", "siteName": "合川餐厨厂", "id": 65, "projectName": "合川餐厨垃圾处置", "treeLabel": "合川餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "12-1-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10058", "companyNo": "00000-00012", "createTime": null, "companyName": "合川益睿公司", "projectType": "PANTRY_DISPOSALS", "id": 58, "projectName": "铜梁餐厨垃圾处置", "treeLabel": "铜梁餐厨垃圾处置", "dataLevel": "PROJECT", "index": "12-2", "sort": 2, "children": [{ "projectNo": "10058", "siteNo": "00020", "companyNo": "00000-00012", "companyName": "合川益睿公司", "siteName": "合川餐厨厂", "id": 66, "projectName": "铜梁餐厨垃圾处置", "treeLabel": "合川餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "12-2-1", "sort": 1, "orgStatus": 0 }] }] }, { "orgStatus": 0, "companyNo": "00000-00011", "createTime": null, "companyName": "鼎瑞公司", "intro": null, "id": 11, "parentId": 1, "treeLabel": "鼎瑞公司", "dataLevel": "COMPANY", "index": 13, "sort": 13, "children": [{ "orgStatus": 0, "projectNo": "10056", "companyNo": "00000-00011", "createTime": null, "companyName": "鼎瑞公司", "projectType": "WATERS_CLEAR", "id": 56, "projectName": "铜梁清漂", "treeLabel": "铜梁清漂", "dataLevel": "PROJECT", "index": "13-1", "sort": 1 }] }, { "orgStatus": 0, "companyNo": "00000-00010", "createTime": null, "companyName": "璧山益杉公司", "intro": null, "id": 10, "parentId": 1, "treeLabel": "璧山益杉公司", "dataLevel": "COMPANY", "index": 14, "sort": 14, "children": [{ "orgStatus": 0, "projectNo": "10052", "companyNo": "00000-00010", "createTime": null, "companyName": "璧山益杉公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 52, "projectName": "璧山生活垃圾收运", "treeLabel": "璧山生活垃圾收运", "dataLevel": "PROJECT", "index": "14-1", "sort": 1 }, { "orgStatus": 0, "projectNo": "10053", "companyNo": "00000-00010", "createTime": null, "companyName": "璧山益杉公司", "projectType": "PANTRY_RECEIVE", "id": 53, "projectName": "璧山餐厨垃圾收运", "treeLabel": "璧山餐厨垃圾收运", "dataLevel": "PROJECT", "index": "14-2", "sort": 2 }, { "orgStatus": 0, "projectNo": "10054", "companyNo": "00000-00010", "createTime": null, "companyName": "璧山益杉公司", "projectType": "PANTRY_RECEIVE", "id": 54, "projectName": "合川餐厨垃圾收运", "treeLabel": "合川餐厨垃圾收运", "dataLevel": "PROJECT", "index": "14-3", "sort": 3 }, { "orgStatus": 0, "projectNo": "10055", "companyNo": "00000-00010", "createTime": null, "companyName": "璧山益杉公司", "projectType": "PANTRY_RECEIVE", "id": 55, "projectName": "铜梁餐厨垃圾收运", "treeLabel": "铜梁餐厨垃圾收运", "dataLevel": "PROJECT", "index": "14-4", "sort": 4 }] }, { "orgStatus": 0, "companyNo": "00000-00009", "createTime": null, "companyName": "北碚运输公司", "intro": null, "id": 9, "parentId": 1, "treeLabel": "北碚运输公司", "dataLevel": "COMPANY", "index": 15, "sort": 15, "children": [{ "orgStatus": 0, "projectNo": "10038", "companyNo": "00000-00009", "createTime": null, "companyName": "北碚运输公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 38, "projectName": "北碚区垃圾收运系统", "treeLabel": "北碚区垃圾收运系统", "dataLevel": "PROJECT", "index": "15-1", "sort": 1, "children": [{ "projectNo": "10038", "siteNo": "00032", "companyNo": "00000-00009", "companyName": "北碚运输公司", "siteName": "北碚转运站", "id": 46, "projectName": "北碚区垃圾收运系统", "treeLabel": "北碚转运站", "disabled": true, "dataLevel": "SITE", "index": "15-1-1", "sort": 1, "orgStatus": 0 }] }] }, { "orgStatus": 0, "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "intro": null, "id": 8, "parentId": 1, "treeLabel": "益渝公司", "dataLevel": "COMPANY", "index": 16, "sort": 16, "children": [{ "orgStatus": 0, "projectNo": "10022", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 22, "projectName": "豹子沟站运营", "treeLabel": "豹子沟站运营", "dataLevel": "PROJECT", "index": "16-1", "sort": 1, "children": [{ "projectNo": "10022", "siteNo": "00009", "companyNo": "00000-00008", "companyName": "益渝公司", "siteName": "豹子沟站", "id": 30, "projectName": "豹子沟站运营", "treeLabel": "豹子沟站", "disabled": true, "dataLevel": "SITE", "index": "16-1-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10023", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "PANTRY_RECEIVE", "id": 23, "projectName": "经开区餐厨", "treeLabel": "经开区餐厨", "dataLevel": "PROJECT", "index": "16-2", "sort": 2 }, { "orgStatus": 0, "projectNo": "10024", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 24, "projectName": "菜园坝站运营", "treeLabel": "菜园坝站运营", "dataLevel": "PROJECT", "index": "16-3", "sort": 3, "children": [{ "projectNo": "10024", "siteNo": "00010", "companyNo": "00000-00008", "companyName": "益渝公司", "siteName": "菜园坝站", "id": 32, "projectName": "菜园坝站运营", "treeLabel": "菜园坝站", "disabled": true, "dataLevel": "SITE", "index": "16-3-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10025", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "PANTRY_RECEIVE", "id": 25, "projectName": "渝中厨余", "treeLabel": "渝中厨余", "dataLevel": "PROJECT", "index": "16-4", "sort": 4 }, { "orgStatus": 0, "projectNo": "10026", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "PANTRY_RECEIVE", "id": 26, "projectName": "大渡口厨余", "treeLabel": "大渡口厨余", "dataLevel": "PROJECT", "index": "16-5", "sort": 5 }, { "orgStatus": 0, "projectNo": "10027", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 27, "projectName": "巴南五站运营", "treeLabel": "巴南五站运营", "dataLevel": "PROJECT", "index": "16-6", "sort": 6 }, { "orgStatus": 0, "projectNo": "10028", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 28, "projectName": "钓鱼嘴站运营", "treeLabel": "钓鱼嘴站运营", "dataLevel": "PROJECT", "index": "16-7", "sort": 7, "children": [{ "projectNo": "10028", "siteNo": "00011", "companyNo": "00000-00008", "companyName": "益渝公司", "siteName": "钓鱼嘴站", "id": 36, "projectName": "钓鱼嘴站运营", "treeLabel": "钓鱼嘴站", "disabled": true, "dataLevel": "SITE", "index": "16-7-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10029", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 29, "projectName": "陈庹路站运营", "treeLabel": "陈庹路站运营", "dataLevel": "PROJECT", "index": "16-8", "sort": 8, "children": [{ "projectNo": "10029", "siteNo": "00012", "companyNo": "00000-00008", "companyName": "益渝公司", "siteName": "陈庹路站", "id": 37, "projectName": "陈庹路站运营", "treeLabel": "陈庹路站", "disabled": true, "dataLevel": "SITE", "index": "16-8-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10030", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 30, "projectName": "沙坪坝区生活", "treeLabel": "沙坪坝区生活", "dataLevel": "PROJECT", "index": "16-9", "sort": 9, "children": [{ "projectNo": "10030", "siteNo": "00013", "companyNo": "00000-00008", "companyName": "益渝公司", "siteName": "大学城站", "id": 38, "projectName": "沙坪坝区生活", "treeLabel": "大学城站", "disabled": true, "dataLevel": "SITE", "index": "16-9-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10031", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 31, "projectName": "高新区生活", "treeLabel": "高新区生活", "dataLevel": "PROJECT", "index": "16-10", "sort": 10, "children": [{ "projectNo": "10031", "siteNo": "00014", "companyNo": "00000-00008", "companyName": "益渝公司", "siteName": "青凤站", "id": 39, "projectName": "高新区生活", "treeLabel": "青凤站", "disabled": true, "dataLevel": "SITE", "index": "16-10-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10032", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "PANTRY_RECEIVE", "id": 32, "projectName": "高新厨余", "treeLabel": "高新厨余", "dataLevel": "PROJECT", "index": "16-11", "sort": 11, "children": [{ "projectNo": "10032", "siteNo": "00015", "companyNo": "00000-00008", "companyName": "益渝公司", "siteName": "白市驿站", "id": 40, "projectName": "高新厨余", "treeLabel": "白市驿站", "disabled": true, "dataLevel": "SITE", "index": "16-11-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10033", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 33, "projectName": "渝北区生活", "treeLabel": "渝北区生活", "dataLevel": "PROJECT", "index": "16-12", "sort": 12 }, { "orgStatus": 0, "projectNo": "10034", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "PANTRY_RECEIVE", "id": 34, "projectName": "两江餐厨", "treeLabel": "两江餐厨", "dataLevel": "PROJECT", "index": "16-13", "sort": 13 }, { "orgStatus": 0, "projectNo": "10035", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "HOUSEHOLDWASTE_RECEIVE", "id": 35, "projectName": "零散收运", "treeLabel": "零散收运", "dataLevel": "PROJECT", "index": "16-14", "sort": 14 }, { "orgStatus": 0, "projectNo": "10036", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "COMPOSITE", "id": 36, "projectName": "垃圾分类", "treeLabel": "垃圾分类", "dataLevel": "PROJECT", "index": "16-15", "sort": 15 }, { "orgStatus": 0, "projectNo": "10037", "companyNo": "00000-00008", "createTime": null, "companyName": "益渝公司", "projectType": "COMPOSITE", "id": 37, "projectName": "物业服务", "treeLabel": "物业服务", "dataLevel": "PROJECT", "index": "16-16", "sort": 16 }] }, { "orgStatus": 0, "companyNo": "00000-00002", "createTime": null, "companyName": "固废处理公司", "intro": "<p>重庆市环鼎公司成立于2002年，是重庆市人民政府出资组建的大型国有企业，主要从事固废垃圾收运处理、重要环卫基础设施建设和运营管理工作。</p>", "id": 2, "parentId": 1, "treeLabel": "固废处理公司", "dataLevel": "COMPANY", "index": 17, "sort": 17, "children": [{ "orgStatus": null, "projectNo": "00001", "companyNo": "00000-00002", "createTime": null, "companyName": "固废处理公司", "projectType": "SOLIDWASTE_DISPOSALS", "id": 1, "projectName": "主城区应急填埋", "treeLabel": "主城区应急填埋", "dataLevel": "PROJECT", "index": "17-1", "sort": 1, "children": [{ "projectNo": "00001", "siteNo": "00018", "companyNo": "00000-00002", "companyName": "固废处理公司", "siteName": "洛碛填埋场", "id": 1, "projectName": "主城区应急填埋", "treeLabel": "洛碛填埋场", "disabled": true, "dataLevel": "SITE", "index": "17-1-1", "sort": 1, "orgStatus": 0 }, { "projectNo": "00001", "siteNo": "00031", "companyNo": "00000-00002", "companyName": "固废处理公司", "siteName": "黑石子填埋场", "id": 2, "projectName": "主城区应急填埋", "treeLabel": "黑石子填埋场", "disabled": true, "dataLevel": "SITE", "index": "17-1-2", "sort": 2, "orgStatus": 0 }] }] }, { "orgStatus": 0, "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "intro": "<p>重庆市益康公司成立于2002年，是重庆市人民政府出资组建的大型国有企业，主要从事固废垃圾收运处理、重要环卫基础设施建设和运营管理工作。</p>", "id": 3, "parentId": 1, "treeLabel": "固废运输公司", "dataLevel": "COMPANY", "index": 18, "sort": 18, "children": [{ "orgStatus": null, "projectNo": "00002", "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "projectType": "TRANSFER", "id": 2, "projectName": "市级转运", "treeLabel": "市级转运", "dataLevel": "PROJECT", "index": "18-1", "sort": 1, "children": [{ "projectNo": "00002", "siteNo": "00001", "companyNo": "00000-00003", "companyName": "固废运输公司", "siteName": "界石站", "id": 3, "projectName": "市级转运", "treeLabel": "界石站", "disabled": true, "dataLevel": "SITE", "index": "18-1-1", "sort": 1, "orgStatus": 0 }, { "projectNo": "00002", "siteNo": "00002", "companyNo": "00000-00003", "companyName": "固废运输公司", "siteName": "走马站", "id": 4, "projectName": "市级转运", "treeLabel": "走马站", "disabled": true, "dataLevel": "SITE", "index": "18-1-2", "sort": 2, "orgStatus": 0 }, { "projectNo": "00002", "siteNo": "00003", "companyNo": "00000-00003", "companyName": "固废运输公司", "siteName": "夏家坝站", "id": 5, "projectName": "市级转运", "treeLabel": "夏家坝站", "disabled": true, "dataLevel": "SITE", "index": "18-1-3", "sort": 3, "orgStatus": 0 }, { "projectNo": "00002", "siteNo": "00004", "companyNo": "00000-00003", "companyName": "固废运输公司", "siteName": "西永站", "id": 6, "projectName": "市级转运", "treeLabel": "西永站", "disabled": true, "dataLevel": "SITE", "index": "18-1-4", "sort": 4, "orgStatus": 0 }, { "projectNo": "00002", "siteNo": "00005", "companyNo": "00000-00003", "companyName": "固废运输公司", "siteName": "城南站", "id": 7, "projectName": "市级转运", "treeLabel": "城南站", "disabled": true, "dataLevel": "SITE", "index": "18-1-5", "sort": 5, "orgStatus": 0 }, { "projectNo": "00002", "siteNo": "00006", "companyNo": "00000-00003", "companyName": "固废运输公司", "siteName": "鱼复站", "id": 8, "projectName": "市级转运", "treeLabel": "鱼复站", "disabled": true, "dataLevel": "SITE", "index": "18-1-6", "sort": 6, "orgStatus": 0 }, { "projectNo": "00002", "siteNo": "00007", "companyNo": "00000-00003", "companyName": "固废运输公司", "siteName": "龙羽站", "id": 9, "projectName": "市级转运", "treeLabel": "龙羽站", "disabled": true, "dataLevel": "SITE", "index": "18-1-7", "sort": 7, "orgStatus": 0 }, { "projectNo": "00002", "siteNo": "00008", "companyNo": "00000-00003", "companyName": "固废运输公司", "siteName": "水土站", "id": 10, "projectName": "市级转运", "treeLabel": "水土站", "disabled": true, "dataLevel": "SITE", "index": "18-1-8", "sort": 8, "orgStatus": 0 }] }, { "orgStatus": null, "projectNo": "00003", "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "projectType": "PANTRY_RECEIVE", "id": 3, "projectName": "高校餐厨收运", "treeLabel": "高校餐厨收运", "dataLevel": "PROJECT", "index": "18-2", "sort": 2 }, { "orgStatus": null, "projectNo": "00004", "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "projectType": "PANTRY_RECEIVE", "id": 4, "projectName": "渝北区厨余收运", "treeLabel": "渝北区厨余收运", "dataLevel": "PROJECT", "index": "18-3", "sort": 3 }, { "orgStatus": null, "projectNo": "00005", "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "projectType": "PANTRY_RECEIVE", "id": 5, "projectName": "高新区餐厨收运", "treeLabel": "高新区餐厨收运", "dataLevel": "PROJECT", "index": "18-4", "sort": 4 }, { "orgStatus": null, "projectNo": "00006", "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "projectType": "PERISHABLE_RECEIVE", "id": 6, "projectName": "沙坪坝区易腐收运", "treeLabel": "沙坪坝区易腐收运", "dataLevel": "PROJECT", "index": "18-5", "sort": 5 }, { "orgStatus": null, "projectNo": "00007", "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "projectType": "PERISHABLE_RECEIVE", "id": 7, "projectName": "九龙坡区易腐收运", "treeLabel": "九龙坡区易腐收运", "dataLevel": "PROJECT", "index": "18-6", "sort": 6 }, { "orgStatus": null, "projectNo": "00008", "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "projectType": "PERISHABLE_RECEIVE", "id": 8, "projectName": "巴南区易腐收运", "treeLabel": "巴南区易腐收运", "dataLevel": "PROJECT", "index": "18-7", "sort": 7 }, { "orgStatus": null, "projectNo": "00009", "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "projectType": "PERISHABLE_RECEIVE", "id": 9, "projectName": "大渡口区易腐收运", "treeLabel": "大渡口区易腐收运", "dataLevel": "PROJECT", "index": "18-8", "sort": 8 }, { "orgStatus": 0, "projectNo": "00010", "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "projectType": "COMPOSITE", "id": 10, "projectName": "隧道清洗", "treeLabel": "隧道清洗", "dataLevel": "PROJECT", "index": "18-9", "sort": 9 }, { "orgStatus": 0, "projectNo": "00011", "companyNo": "00000-00003", "createTime": null, "companyName": "固废运输公司", "projectType": "COMPOSITE", "id": 11, "projectName": "PET生产", "treeLabel": "PET生产", "dataLevel": "PROJECT", "index": "18-10", "sort": 10 }] }, { "orgStatus": 0, "companyNo": "00000-00004", "createTime": null, "companyName": "渝环公司", "intro": "<p>重庆市涪陵益晖成立于2002年，是重庆市人民政府出资组建的大型国有企业，主要从事固废垃圾收运处理、重要环卫基础设施建设和运营管理工作。</p>", "id": 4, "parentId": 1, "treeLabel": "渝环公司", "dataLevel": "COMPANY", "index": 19, "sort": 19, "children": [{ "orgStatus": 0, "projectNo": "00012", "companyNo": "00000-00004", "createTime": null, "companyName": "渝环公司", "projectType": "PANTRY_DISPOSALS", "id": 12, "projectName": "主城区餐厨垃圾处置", "treeLabel": "主城区餐厨垃圾处置", "dataLevel": "PROJECT", "index": "19-1", "sort": 1, "children": [{ "projectNo": "00012", "siteNo": "00019", "companyNo": "00000-00004", "companyName": "渝环公司", "siteName": "洛碛餐厨厂", "id": 20, "projectName": "主城区餐厨垃圾处置", "treeLabel": "洛碛餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "19-1-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "00013", "companyNo": "00000-00004", "createTime": null, "companyName": "渝环公司", "projectType": "PANTRY_DISPOSALS", "id": 13, "projectName": "主城区厨余垃圾处置", "treeLabel": "主城区厨余垃圾处置", "dataLevel": "PROJECT", "index": "19-2", "sort": 2, "children": [{ "projectNo": "00013", "siteNo": "00019", "companyNo": "00000-00004", "companyName": "渝环公司", "siteName": "洛碛餐厨厂", "id": 21, "projectName": "主城区厨余垃圾处置", "treeLabel": "洛碛餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "19-2-1", "sort": 1, "orgStatus": 0 }] }] }, { "orgStatus": 0, "companyNo": "00000-00005", "createTime": null, "companyName": "环鼎公司", "intro": "<p>重庆市固废处理成立于2002年，是重庆市人民政府出资组建的大型国有企业，主要从事固废垃圾收运处理、重要环卫基础设施建设和运营管理工作。</p>", "id": 5, "parentId": 1, "treeLabel": "环鼎公司", "dataLevel": "COMPANY", "index": 20, "sort": 20, "children": [] }, { "orgStatus": 0, "companyNo": "00000-00006", "createTime": null, "companyName": "益康公司", "intro": "<p>重庆市固废运输成立于2002年，是重庆市人民政府出资组建的大型国有企业，主要从事固废垃圾收运处理、重要环卫基础设施建设和运营管理工作。</p>", "id": 6, "parentId": 1, "treeLabel": "益康公司", "dataLevel": "COMPANY", "index": 21, "sort": 21, "children": [{ "orgStatus": 0, "projectNo": "00014", "companyNo": "00000-00006", "createTime": null, "companyName": "益康公司", "projectType": "SEWAGE_DISPOSALS", "id": 14, "projectName": "黑石子渗滤液处置", "treeLabel": "黑石子渗滤液处置", "dataLevel": "PROJECT", "index": "21-1", "sort": 1, "children": [{ "projectNo": "00014", "siteNo": "00031", "companyNo": "00000-00006", "companyName": "益康公司", "siteName": "黑石子填埋场", "id": 22, "projectName": "黑石子渗滤液处置", "treeLabel": "黑石子填埋场", "disabled": true, "dataLevel": "SITE", "index": "21-1-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "00015", "companyNo": "00000-00006", "createTime": null, "companyName": "益康公司", "projectType": "SEWAGE_DISPOSALS", "id": 15, "projectName": "洛碛渗滤液处置", "treeLabel": "洛碛渗滤液处置", "dataLevel": "PROJECT", "index": "21-2", "sort": 2, "children": [{ "projectNo": "00015", "siteNo": "00018", "companyNo": "00000-00006", "companyName": "益康公司", "siteName": "洛碛填埋场", "id": 23, "projectName": "洛碛渗滤液处置", "treeLabel": "洛碛填埋场", "disabled": true, "dataLevel": "SITE", "index": "21-2-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "00016", "companyNo": "00000-00006", "createTime": null, "companyName": "益康公司", "projectType": "SEWAGE_DISPOSALS", "id": 16, "projectName": "洛碛餐厨污水处置", "treeLabel": "洛碛餐厨污水处置", "dataLevel": "PROJECT", "index": "21-3", "sort": 3, "children": [{ "projectNo": "00016", "siteNo": "00019", "companyNo": "00000-00006", "companyName": "益康公司", "siteName": "洛碛餐厨厂", "id": 24, "projectName": "洛碛餐厨污水处置", "treeLabel": "洛碛餐厨厂", "disabled": true, "dataLevel": "SITE", "index": "21-3-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "00017", "companyNo": "00000-00006", "createTime": null, "companyName": "益康公司", "projectType": "SEWAGE_DISPOSALS", "id": 17, "projectName": "界石污水处置", "treeLabel": "界石污水处置", "dataLevel": "PROJECT", "index": "21-4", "sort": 4, "children": [{ "projectNo": "00017", "siteNo": "00001", "companyNo": "00000-00006", "companyName": "益康公司", "siteName": "界石站", "id": 25, "projectName": "界石污水处置", "treeLabel": "界石站", "disabled": true, "dataLevel": "SITE", "index": "21-4-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "00018", "companyNo": "00000-00006", "createTime": null, "companyName": "益康公司", "projectType": "SEWAGE_DISPOSALS", "id": 18, "projectName": "走马污水处置", "treeLabel": "走马污水处置", "dataLevel": "PROJECT", "index": "21-5", "sort": 5, "children": [{ "projectNo": "00018", "siteNo": "00002", "companyNo": "00000-00006", "companyName": "益康公司", "siteName": "走马站", "id": 26, "projectName": "走马污水处置", "treeLabel": "走马站", "disabled": true, "dataLevel": "SITE", "index": "21-5-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10019", "companyNo": "00000-00006", "createTime": null, "companyName": "益康公司", "projectType": "SEWAGE_DISPOSALS", "id": 19, "projectName": "夏家坝污水处置", "treeLabel": "夏家坝污水处置", "dataLevel": "PROJECT", "index": "21-6", "sort": 6, "children": [{ "projectNo": "10019", "siteNo": "00003", "companyNo": "00000-00006", "companyName": "益康公司", "siteName": "夏家坝站", "id": 27, "projectName": "夏家坝污水处置", "treeLabel": "夏家坝站", "disabled": true, "dataLevel": "SITE", "index": "21-6-1", "sort": 1, "orgStatus": 0 }] }, { "orgStatus": 0, "projectNo": "10020", "companyNo": "00000-00006", "createTime": null, "companyName": "益康公司", "projectType": "SEWAGE_DISPOSALS", "id": 20, "projectName": "洛碛原水净化", "treeLabel": "洛碛原水净化", "dataLevel": "PROJECT", "index": "21-7", "sort": 7, "children": [{ "projectNo": "10020", "siteNo": "00018", "companyNo": "00000-00006", "companyName": "益康公司", "siteName": "洛碛填埋场", "id": 28, "projectName": "洛碛原水净化", "treeLabel": "洛碛填埋场", "disabled": true, "dataLevel": "SITE", "index": "21-7-1", "sort": 1, "orgStatus": 0 }] }] }, { "orgStatus": 0, "companyNo": "00000-00007", "createTime": null, "companyName": "水域公司", "intro": "<p>重庆市渝环公司成立于2002年，是重庆市人民政府出资组建的大型国有企业，主要从事固废垃圾收运处理、重要环卫基础设施建设和运营管理工作。</p>", "id": 7, "parentId": 1, "treeLabel": "水域公司", "dataLevel": "COMPANY", "index": 22, "sort": 22, "children": [{ "orgStatus": 0, "projectNo": "10021", "companyNo": "00000-00007", "createTime": null, "companyName": "水域公司", "projectType": "WATERS_CLEAR", "id": 21, "projectName": "主城清漂", "treeLabel": "主城清漂", "dataLevel": "PROJECT", "index": "22-1", "sort": 1 }] }] }
      ],
      showData: [],
      form: {
        organizationName: '',
        orgStatus: ''
      },
      defaultProps: {
        children: 'children',
        label: 'treeLabel'
      },
      // 筛选是否保留子节点
      keepChild: false
    }
  },
  created() {
    this.showData = this.tableData
  },
  methods: {
    handleEdit() {
      console.log('edit')
    },
    handleDelete() {
      console.log('delete')
    },
    handleAdd() {
      console.log('add')
    },
    handleSearch() {
      this.$refs.orgTree.filter(this.form)
      this.setCurrentData()
    },
    handleReset() {
      this.form = {
        organizationName: '',
        orgStatus: ''
      }
      this.showData = this.tableData
    },
    //因为需要筛选出过滤的父节点以及其所有子节点,只调用element-ui自带的方法只会返回对应的数据,因此需要进行改造筛选条件
    filterNode(value, data, node) {
      if (!value.organizationName && !value.orgStatus) return true
      // 若不保留子节点,则直接判断当前节点是否符合条件
      if (!this.keepChild) return data.treeLabel.indexOf(value.organizationName) != -1 && String(data.orgStatus).includes(String(value.orgStatus))
      // 若保留子节点,则需要判断当前节点是否符合条件,若不符合,则需要判断其父节点是否符合条件
      let _array = [] //这里使用数组存储 只是为了存储值。
      this.getReturnNode(node, _array, value)
      let result = false
      _array.forEach(item => {
        result = result || item
      })
      return result
    },
    getReturnNode(node, _array, value) {
      let isPass =
        node.data &&
        node.data.treeLabel.indexOf(value.organizationName) != -1 &&
        String(node.data.orgStatus).includes(String(value.orgStatus))
      isPass ? _array.push(isPass) : ""
      if (!isPass && node.level != 1 && node.parent) {
        this.getReturnNode(node.parent, _array, value)
      }
    },
    // 获取过滤后的数据的操作代码
    setCurrentData() {
      const traverseNode = function (node) {
        if (Object.prototype.toString.call(node) === '[object Array]') {
          return node.map(t => traverseNode(t))
        }
        const data = { id: node.id, label: node.label, ...node.data, visible: node.visible, children: [] }
        const childNodes = node.childNodes
        childNodes.forEach((child) => {
          const item = traverseNode(child)
          if (item.visible) {
            data.visible = true
          }
          data.children.push(item)
        })
        return data
      }
      const traverseVisible = function (arr) {
        return arr.filter(t => {
          let visible = t.visible
          if (!visible) {
            return false
          }
          if (t.children) {
            t.children = traverseVisible(t.children)
          }
          delete t.visible
          return visible
        })
      }
      const data = traverseNode(this.$refs.orgTree.store.root.childNodes)
      this.showData = traverseVisible(data)
    },
  }
}
</script>
<style scoped lang="scss">
.home {
  padding: 0 40px;

  .organization-name {
    padding: 0;
    margin: 0;
    text-align: center;
  }

  .el-switch-btn {
    margin-left: 20px;
  }
}
</style>
